package com.hdax.dm.api;

import com.hdax.dm.entity.order.Order;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public interface OrderControllerApi {

    @PostMapping(path = "/rest/order/detail")
    Order detail(@RequestParam("orderNo")String orderNo);

    @PostMapping(path = "/rest/order/add/tradeno")
    Boolean addTradeNo(@RequestParam("orderNo")String orderNo, @RequestParam("tradeNo")String tradeNo);
    /**
     * 根据商品编号和用户编号查询订单条数
     * @param userId
     * @param itemId
     * @return
     */
    @RequestMapping("/rest/getCount")
    Long getCount(@RequestParam("userId") Long userId,@RequestParam("itemId") Long itemId);


    @RequestMapping("/rest/selectOne")
    Order selectOne(@RequestParam("orderNo") String orderNo);
    /**
     * 修改订单状态已退款
     * @param orderNo
     * @return
     */
    @RequestMapping("/rest/updateTwo")
    boolean updateTwo(@RequestParam("schedulerId") String orderNo);
}